//
//  HomeStore.m
//  NewPro
//
//  Created by RYX on 2019/4/16.
//  Copyright © 2019 何荧红. All rights reserved.
//

#import "HomeStore.h"

@implementation HomeStore

#pragma mark - 获取系统公告
- (void)getHomeToastSuccess:(void(^)(NSString *title, NSString *content))success Failure:(void(^)(NSError *error))failure{
    
    NSString *url = [NSString stringWithFormat:@"%@/api/system/notice",IP];
    
    [HttpTool postUrlWithString:url parameters:nil success:^(id responseObject) {
        
        NSError *error = [HttpTool inspectError:responseObject];
        if (error == nil) {
            
            NSString *title = responseObject[@"data"][@"title"];
            NSString *str = responseObject[@"data"][@"content"];
            
            if (str.length <= 0) {
                
                return failure(error);
            }
            
            NSString *content = [NSString stringWithFormat:@"%@                     %@                     %@                     %@                     %@                     ",str,str,str,str,str];
            success(title,content);
            
        }else{
            
            failure(error);
        }
        
    } failure:^(NSError *error) {
       
        failure(error);
    }];
    
}

@end
